package com.cskaoyan.controller.wxcontroller;

import com.cskaoyan.bean.bo.wx.WxFeedbackBO;
import com.cskaoyan.bean.pojo.User;
import com.cskaoyan.bean.vo.BaseRespVo;
import com.cskaoyan.service.FeedbackService;
import org.apache.shiro.SecurityUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author: hdf
 * @class: FeedbackController
 */
@RestController
@RequestMapping("wx/feedback")
public class FeedbackController {

    @Autowired
    FeedbackService feedbackService;

    @PostMapping("submit")
    public BaseRespVo feedbackSubmit(@RequestBody WxFeedbackBO wxFeedbackBO){
        User principal = (User) SecurityUtils.getSubject().getPrincipal();
        feedbackService.feedbackSubmit(wxFeedbackBO,principal);
        return BaseRespVo.ok();
    }
}
